package com.login;



public class ActionManagerImpel implements ActionManager{
	private ManagerDao managerDao;
	
	public void setManagerDao(ManagerDao managerDao){
		this.managerDao=managerDao;
	}
	public ManagerDao getManagerDao(){
		return this.managerDao;
	}
	
	public boolean validLogin(String id,String pass) throws Exception{
		try{
			Manager manager=managerDao.findManager(id, pass);
			if(manager!=null)return true;
			else return false;
		}
		catch(Exception e){
			throw e;
		}
	}
	
	public Manager getManager(String id,String pass) throws Exception{
		try{
			Manager manager=managerDao.findManager(id, pass);
			return manager;
		}
		catch(Exception e){
			throw e;
		}
	}
	public void update(String id,String pass,String name)throws Exception{
		try{
			managerDao.updateManager(id,pass,name);
		}
		catch(Exception e){
			throw e;
		}
	}
}
